﻿/******************************************************************************
    myBoard is a port of MacOS X dashboard application for windows.
    Copyright (C) 2007,2008  by Yann ALET
    Email : yann.alet@gmail.com

    myBoard is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    myBoard is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
****************************************************************************/

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace myBoard.App
{
    public static class myBoardKeys
    {
        private static List<string> _mouseButtons;
        private static List<string> _keyboardButtons;
        private static List<string> _combinationButtons;

        public static List<string> MouseButtons
        {
            get { return _mouseButtons; }
        }

        public static List<string> KeyboardButtons
        {
            get { return _keyboardButtons; }
        }

        public static List<string> CombinationButtons
        {
            get { return _combinationButtons; }
        }

        static myBoardKeys()
        {
            _keyboardButtons = new List<string>();
            _mouseButtons = new List<string>();
            _combinationButtons = new List<string>();

            string[] keys = Enum.GetNames(typeof(Keys));
            foreach (string key in keys)
                _keyboardButtons.Add(key);

            string[] mouseButs = Enum.GetNames(typeof(MouseButtons));
            foreach (string mouseBut in mouseButs)
                _mouseButtons.Add(mouseBut);

            _combinationButtons.Add("RightShift");
            _combinationButtons.Add("RightCtrl");
            _combinationButtons.Add("RightAlt");
            _combinationButtons.Add("LeftShift");
            _combinationButtons.Add("LeftCtrl");
            _combinationButtons.Add("LeftAlt");
        }

        public static string GetMouseButton(MouseButtons but)
        {
            return Enum.GetName(typeof(MouseButtons), but);
        }

        public static string GetKeyboardKey(Keys key)
        {
            return Enum.GetName(typeof(Keys), key);
        }

        public static Keys GetKeyboardKey(string key)
        {
            return (Keys)Enum.Parse(typeof(Keys), key);
        }        

        public static MouseButtons GetMouseButton(string but)
        {
            return (MouseButtons)Enum.Parse(typeof(MouseButtons), but);
        }

    }
}
